Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 7 - Process Management / Process Management Reference
Functions / Working With Deferred Tasks


OTScheduleInterruptTask

Schedules a task for execution at deferred task time.

C INTERFACE
Boolean OTScheduleInterruptTask(long dtCookie)
C++ INTERFACES
None. C++ applications use the C interface to this function.

PARAMETERS
dtCookie
A reference that identifies the task to be scheduled.
DESCRIPTION
The OTScheduleInterruptTask function schedules for execution at the next deferred task time the task associated with the dtCookie parameter, which is the reference returned by the OTCreateDeferredTask function. This call includes internal calls to the EnterInterrupt and the LeaveInterrupt functions, so you do not need to make separate calls to those functions as you do with other similar functions.

You can call this function at any time. If you have not yet destroyed a task, you can use this function to reschedule it multiple times.

If you make multiple calls to the OTScheduleInterruptTask function before the task is executed, additional tasks are not scheduled; only one instance of each unique task can be scheduled at a time.

This function returns true if it scheduled the deferred task successfully, false if not. If it returns false and the dtCookie parameter has a valid value (other than 0), then the task is already scheduled to run. If dtCookie is invalid (a value of 0), the function returns false and does nothing.

If you want to call Open Transport from an interrupt, you can use this function (and the OTCreateDeferredTask function) instead of the standard Deferred Task Manager function DTInstall to create a deferred task that permits you to call Open Transport function calls. This allows Open Transport to adapt to changes in the underlying operating system without affecting the client's code.

SPECIAL CONSIDERATIONS
You can call this Open Transport function at interrupt time without calling the OTEnterInterrupt function first and the OTLeaveInterrupt function afterwards.

SEE ALSO
To create a deferred task for execution at deferred task time, call the OTCreateDeferredTask function (page 7-14).

To destroy a task created with the OTCreateDeferredTask function, call the OTDestroyDeferredTask function (page 7-18).


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996